<template>
<div>
    <div class="l">
        <div class="header">
            <input type="text" placeholder="请输入您要收索的机型" class="shousuo" >
            <img src="img/Assistant/1.jpg" alt="">
        </div>
        <div class="nav-1">
           <a href="#" @click="gotoSplb">
               <div class="home-nav">
                 <div class="p"></div>
                 <h6>全部商品</h6>
               </div>
           </a>
         <a href="#" @click="gotoSplb">
               <div class="home-nav">
                 <div class="p1"></div>
                 <h6>每日精选</h6>
               </div>
           </a>
           <a href="#"  @click="gotoSplb">
               <div class="home-nav">
                 <div class="p2"></div>
                 <h6>最新发布</h6>
               </div>
           </a>
           <a href="#"  @click="gotoSplb">
               <div class="home-nav">
                 <div class="p3"></div>
                 <h6>手机回收</h6>
               </div>
           </a>
        </div>
    </div>
    <div class="jingxuan">
        <div class="jingxuan-nav">
            <span>精选机型</span>
            <a href="#"  @click="gotoSplb">查看全部</a>
        </div>
        <div class="home-hot-box">
            <div class="q1"  v-for="(item, i) of arr" :key="i"  @click="gotoxqlb">
               <a href="#" ><img :src="`http://127.0.0.1:3000/${item.photo_url}`" /></a>
                <p>{{ item.name }}</p>
                <span>¥{{ item.prise }}</span>
            </div>
           
        </div>
    </div>
    <div class="remen">
        <div class="jingxuan-nav">
            <span>热门推介</span>
            <a href="#"  @click="gotoSplb">更多></a>
        </div>
        <div class="hydrated">
            <a href="#" class="phone pg" @click="gotoSplb"></a>
            <a href="#" class="phone hw" @click="gotoSplb"></a>
            <a href="#" class="phone op" @click="gotoSplb"></a>
            <a href="#" class="phone vi" @click="gotoSplb"></a>
        </div>
    </div>
    <div class="navbar">
        <mt-navbar class="navbar-1" v-model="a">
            <mt-tab-item id="1">全部</mt-tab-item>
            <mt-tab-item id="2">全新</mt-tab-item>
            <mt-tab-item id="3">99新</mt-tab-item>
            <mt-tab-item id="4">95新</mt-tab-item>
            <mt-tab-item id="5">9成新</mt-tab-item>
        </mt-navbar>
        <!-- tab-container -->
        <mt-tab-container  v-model="a">
        <mt-tab-container-item id="1">
          <div class="quanbu">
           <a href="javascript:;"  v-for="(item, i) of arr" :key="i" @click="gotoxqlb">
              <div class="m1">
                   <img :src="`http://127.0.0.1:3000/${item.photo_url}`" />
                   <div>
                        <h5>{{item.name}}</h5>
                        <span>¥{{ item.prise }}</span>
                        <p>95成新 绿色  64</p>
                        <a href="#" class="qiang">立即抢购</a>
                   </div>
               </div>
           </a>
            </div>
        </mt-tab-container-item>
        <mt-tab-container-item id="2">
            <div class="quanbu">
                <h6>没有更多产品啦</h6>
            </div>
        </mt-tab-container-item>
        <mt-tab-container-item id="3">
            <div class="quanbu">
                <h6>没有更多产品啦</h6>
            </div>
        </mt-tab-container-item>
        <mt-tab-container-item id="4">
        <div class="quanbu">
           <a href="javascript:;"  v-for="(item, i) of arr" :key="i" @click="gotoxqlb">
              <div class="m1">
                   <img :src="`http://127.0.0.1:3000/${item.photo_url}`" />
                   <div>
                        <h5>{{item.name}}</h5>
                        <span>¥{{ item.prise }}</span>
                        <p>95成新 灰色  128</p>
                        <a href="#" class="qiang">立即抢购</a>
                   </div>
               </div>
           </a>
            </div>
        </mt-tab-container-item>
        <mt-tab-container-item id="5">
        <div class="quanbu">
           <a href="javascript:;"  v-for="(item, i) of arr" :key="i" @click="gotoxqlb">
              <div class="m1">
                   <img :src="`http://127.0.0.1:3000/${item.photo_url}`" />
                   <div>
                        <h5>{{item.name}}</h5>
                        <span>¥{{ item.prise }}</span>
                        <p>9成新 红色  64</p>
                        <a href="#" class="qiang">立即抢购</a>
                   </div>
               </div>
           </a>
            </div>
        </mt-tab-container-item>
        </mt-tab-container>
    </div>
    <div class="footer">
    <mt-tabbar v-model="selected" fixed>
       <mt-tab-item id="1" @click.native="gotoindex" >
        <img slot="icon" src="img/Assistant/jiu1.png">
        卖旧机
       </mt-tab-item>
       <mt-tab-item id="2" >
        <img slot="icon" src="img/Assistant/ji1.png">
        买二手
       </mt-tab-item>
       <mt-tab-item id="3"  @click.native="gotowode">
        <img slot="icon" src="img/Assistant/me1.png">
        我的
        </mt-tab-item>
        </mt-tabbar>
    </div>
</div>
</template>

<script>
export default {
    data(){
        return {
            a:'1',
            selected:"2",
            arr:[]
        }
    },
    methods:{ //跳转页面
       gotoindex(){
           this.$router.push({path:'/index/recommend'})
       },
       gotowode(){
           this.$router.push({path:'/aboutme'})
       },
       gotoSplb(){
           this.$router.push({path:'/renewindex/renew'})
       },
       gotoxqlb(){
           this.$router.push({path:'/prodetail/苹果%20iPhone%2012%20Pro%20Max/8500'})
       }
    },
    mounted(){
     this.axios.get("/products/index?pno=1").then((res) => {
          this.arr = res.data.data;})
    }
}
</script>

<style>
  *{
      margin: 0 auto;
      padding: 0;
  }
  a{
      text-decoration: none;
  }
  .l{
    width:100%;
    position: relative;
  }
 .shousuo{
     position: absolute;
     top: 10px;
     left: 16px;
     padding-left:15px ;
     display: block;
     width: 90%;
     height: 32px;
     border-radius: 16px;
     white-space: pre-wrap;
     font-weight: 400;
     background-color: rgba(255, 255, 255, 0.5);
     outline-style: none;
     border: 0px;
     font-size:12px ;
 }
 input::-webkit-input-placeholder{
      color: #ffffff;}
 .header{
     position: relative;
 }
  .header img{
      width: 100%;
  }
  .nav-1{
      position: absolute;
      top: 163px;
      left: 8px;
      width: 96%;
      border-radius:5px ;
      background-color:#ffffff ;
  }
 .home-nav{
      width: 25%;
      height: 84px;
      display: inline-block;
  }
  .p,.p1,.p2,.p3{
     width: 126%;
     height: 79%; 
    transform: scale(0.5);
  }
.p{background: url(/img/Assistant/20190924124310_59059.png)  no-repeat 6px -1px;}
.p1{background: url(/img/Assistant/20190924124310_59059.png)  no-repeat -169px -1px;}
.p2{background: url(/img/Assistant/20190924124310_59059.png)  no-repeat -339px -1px;}
.p3{background: url(/img/Assistant/20190924124310_59059.png)  no-repeat -509px -1px;}
.home-nav h6{
      text-align: center;
      font-size: 13px;
      color: black;
      font-weight: 400;
}
.jingxuan{
    width: 100%;
    margin-top: 85px;
    padding-top:10px ;
}
.jingxuan-nav{
    width: 100%;
}
.jingxuan-nav::after{
    display: block;
    content: "";
    clear: both;
}
.jingxuan-nav span{
    float: left;
    margin-left:10px ;
    color: #333333;
    font-size: 18px;
    font-weight: 700;
}
.jingxuan-nav a{
    float: right;
    margin-right:10px ;
    color: #333333;
    font-size: 15px;
}
.home-hot-box{
    width: 97%;
    margin: 10px 10px;
    float: left;
    /* 让超出的元素在x轴滚动 */
    overflow-x: scroll;
    /* 不换行!! */
    white-space: nowrap;
}
.home-hot-box::-webkit-scrollbar {/*隐藏滚轮*/
   display: none;
}
.home-hot-box .q1{
    display: inline-block;
    /* 子元素换行 */
    white-space:pre-wrap;
    margin: 9px 9px 9px 0px;
    padding: 10px 0px 10px 0px;
    margin-top: 10px;
    width: 135px;
    background-color: #fff;
    border: 1px solid #ccc;
    border-radius:12px ;
}
.home-hot-box .q1 img{
    width: 100%;
}
.home-hot-box .q1 p{
    padding: 0px 8px;
    height: 26px;
    color: #3e3836;
    font-size: 13px;
}
.home-hot-box .q1 span{
    color: #ff202c;
    font-size: 14px;
    margin: 12px 8px 0px 8px ;
    text-align: center;
}
.remen{
    margin-top:5px;
    padding: 20px 10px 0px 10px;
    clear:both
}
.jingxuan-nav1 span{
    float: left;
    color: #333333;
    font-size: 18px;
    font-weight: 700;
}
.jingxuan-nav1 a{
    float: right;
    color: #333333;
    font-size: 15px;
}
.hydrated{
    padding: 10px 0px;
}
.phone{
    display: inline-block;
    margin-right: 18px;
    height: 75px;
    width: 75px;
    background: url(/img/Assistant/jl2.png);
    background-size: 373px 84px;
}
.pg{
    background-position: -5px -4px;
}
.hw{
    background-position: -102px -5px;
}
.op{
    background-position: -199px -5px;
}
.hydrated .vi{
    background-position: -295px -5px;
    margin-right: 0px;
}
.navbar{
    margin-top: 5px;
    padding: 20px 10px 0px 10px;
}

.navbar .mint-tab-item{
    margin-right:12px ;
    padding: 0 !important;
    line-height: 26px;
}
.navbar .mint-tab-item .mint-tab-item-label{
    display: inline-block;
    font-size: 15px !important;
    font-weight: 700!important;
}
.navbar .mint-navbar .mint-tab-item.is-selected{
    background-color: #f74444;
    border-radius: 15px;
    color: #ffffff !important;
    border-bottom: 0;
}
.quanbu{
    margin-bottom:50px ;
    position: relative;
    width: 100%;
    padding: 15px 0px 20px 0px;
}
.quanbu .m1{
    /* margin: 0 auto; */
    margin-bottom: 15px; 
    margin-left:15px ;
}
.quanbu a{
    display: inline-block;
}
.quanbu .m1 img{
    float: left;
}
.quanbu .m1 div{
    float: left;
    width: 63%;
    margin: 15px 0px 0px 23px ;
}
.m1::after{
    display: block;
    content: "";
    clear: both;
}
.quanbu .m1 h5{
    display: inline-block;
    width: 150px;
    height: 40px;
    color: #333333;
    font-weight: 400;
}
.quanbu .m1 span{
    position: absolute;
    margin-left:20px;
    color:#f74444 ;
    font-size: 15px;
}
.quanbu .m1 p{
    color: #999999;
    font-size: 12px;
    margin-top:5px ;
}
.quanbu .m1 .qiang{
    width: 105px;
    height: 33px;
    margin: 5px 0px 0px 110px;
    display: block;
    background-color:#f74444 ;
    color: #fff;
    text-align: center;
    line-height: 33px;
    border-radius:20px ;
}
.quanbu h6{
    padding-top:20px ;
    text-align: center;
    font-weight: 400;
}
.footer .mint-tabbar > .mint-tab-item.is-selected{
    color:#f9415d ;
}
</style>